/**
  ******************************************************************************
  * @文件     spim.h
  * @作者     hero_cao
  * @版本     V1.0.0
  * @日期     2020/10/29
  * @概要     flash读写库
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SPIM_H_
#define __SPIM_H_

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
#define SPIM_TEST_ADDR              ((uint32_t)0x08400000)
#define SPIM_PAGE_SIZE              4096

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void flash_init_spim(void);
void SPIM_test(void);
int flash_page_erase(uint32_t page_addr);
int flash_write(uint32_t addr, uint8_t *data, uint32_t data_len);
int flash_read(uint32_t addr, uint8_t *data, uint32_t data_len);

#endif /* __SPIM_H_ */
